#ifndef _MODELRENDERCOMP_H_
#define _MODELRENDERCOMP_H_

#include <SECore/Ecs/Component.h>
#include <SEngine/Render/Entity/Model.h>
#include <SECore/Reflect.h>

namespace SEngine
{


    struct ModelRenderComp : public Component<ModelRenderComp>
    {
        ENABLE_SERIALIZE(Component<ModelRenderComp>)
        ModelRenderComp(Actor & actor) : Component(actor) {}
        virtual ~ModelRenderComp() = default;
        void Attach() override;
        void Load(const std::string & modelName);
        void OnModelSerialize(std::string& str);
        void OnModelDeserialize(const std::string & str);
        Model m_model;
    };

    REF_REGISTER_CLASS(ModelRenderComp,
        REF_REGISTER_FIELD(ModelRenderComp, m_model)
    )
}

#endif